package com.jslx.service.sechled;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * Created by ydw on 2017/7/22.
 */
//@Service
public class TestSchService {

    @Scheduled(fixedDelay = 1000)
    @Async
    public void test(){
        System.out.println(Thread.currentThread().getName()+":每一秒打印这句话");
    }

    @Scheduled(fixedDelay = 2000)
    @Async
    public void test2(){
        System.out.println(Thread.currentThread().getName()+":每两秒打印这句话");
    }
}
